﻿using UnityEngine;
using UnityEngine.SceneManagement;
using System.Collections;

public enum Link_type
	{
		door,
		edge,
		other,
	};


public class Link : MonoBehaviour {

	public string scenenname;
	public Link_type link_type;


	public Scene_note LingkScenen;
	public string trigger_tag = "Player";

	public Dungenon testmap;

	//private bool isload = false;

	// Use this for initialization
	void Start () {
	
	}
	//bool drwait = false;
	// Update is called once per frame
	void Update ()
	{
		// if (drwait) 
		// {
		// 	testmap.DrawMap();
		// }
	}
	void OnTriggerEnter(Collider collider)
	{
		if (collider.gameObject.tag == "Player") 
		{
			if (LingkScenen == null) 
			{
				//创建一个符合条件的随机场景
				LingkScenen = new Scene_note();
			}
			if (!LingkScenen.isload) 
			{
				LingkScenen.isload = Gamecontrol.Instance.add_scene(LingkScenen);
				// testmap = new Dungenon(50,50,500);
				// //drwait = true;
				// Gamecontrol.Instance.CreateSceneByMap(testmap, new Vector3(50f,0f,50f));
			}
			
		}
		
	}
}
